function $(id) {
    console.log(id);
    
    return !id ? null : document.getElementById(id);
}



function toggle_collapse(objname, noimg, complex, lang) {
    _toggle_collapse(objname)
}

function _toggle_collapse(objname, noimg = null, complex = null, lang = null) {
    var obj = $(objname);
    if (obj) {
        obj.style.display = obj.style.display == '' ? 'none' : '';
    }
    if (!noimg) {
        var img = $(objname + '_img');
        if (img.tagName != 'IMG') {
            if (img.className.indexOf('_yes') == -1) {
                img.className = img.className.replace(/_no/, '_yes');
                if (lang) {
                    img.innerHTML = lang[0];
                }
            } else {
                img.className = img.className.replace(/_yes/, '_no');
                if (lang) {
                    img.innerHTML = lang[1];
                }
            }
        } else {
            img.src = img.src.indexOf('_yes.gif') == -1 ? img.src.replace(/_no\.gif/, '_yes\.gif') : img.src.replace(/_yes\.gif/, '_no\.gif');
        }
        img.blur();
    }
    if (complex) {
        var objc = $(objname + '_c');
        if (objc) {
            objc.className = objc.className == 'umh' ? 'umh umn' : 'umh';
        }
    }
}